package com.cf.model;

import com.cf.code.core.CField;
import com.cf.code.core.CModel;
import com.cf.code.core.CPage;
import com.cf.code.core.FieldType;
import com.cf.crud.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * boot-shop-SPU
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/8/16 下午 03:04
 */
@Entity
@Table(name = "spu")
@CModel(pages = {
        @CPage(title = "spu", path = "spu", templateName = "list.ftl", outPutName = "list.ftl"),
        @CPage(title = "spu", path = "spu", templateName = "add.ftl", outPutName = "add.ftl"),
        @CPage(title = "spu", path = "spu", templateName = "update.ftl", outPutName = "update.ftl")
})
public class SPU extends BaseEntity {

    @CField(lab = "名字")
    private String name;

    @CField(lab = "图片", type = FieldType.FILE)
    @Column(name = "iconImg")
    private String iconImg;

    @Column(name = "categoryId")
    @CField(lab = "类目Id", type = FieldType.SELECT, dataUrl = "/category/search?name=", selectKey = "name", selectValue = "id")
    private long categoryId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public String getIconImg() {
        return iconImg;
    }

    public void setIconImg(String iconImg) {
        this.iconImg = iconImg;
    }

    public long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(long categoryId) {
        this.categoryId = categoryId;
    }
}
